<?php

namespace app\common\model;

use think\Model;

/**
 * 模型
 */
class RoleUser extends Model
{
    // 表名
    protected $name = 'role_user';
    protected $deleteTime = false;
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';

    public static function getRoleIdByCondition($condition)
    {
        return self::where($condition)->value('role_id');
    }

    public function member()
    {
        return $this->belongsTo('member', 'member_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }



}
